﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AdvanceLib.AddIn;
using AdvanceLib.Core.Configuration;
using AdvanceLib.ScriptCore;
using AdvanceLib.ScriptCore.DebugCore;
using AdvanceLib.ScriptCore.Formatters;
using AdvanceLib.Extension.Root.DebugPasses;

namespace AdvanceLib.Extension.Root
{
    public class RootProvider : IExtensionProvider
    {
        #region IExtensionProvider Member
        public IFormatter Formatter
        {
            get { return new DefaultFormatter(); }
        }
        public IDebugger Debugger
        {
            get 
            {
                return new Debugger()
                {
                    DebugPasses = new List<IDebugPass>()
                    {
                        new ParameterValidationPass(this),
                        new SystemCommandExistsPass(this),
                        new SystemCommandConflictPass(this),
                        new ParameterCountPass(this)
                    }
                };
            }
        }
        public IParser Parser
        {
            get { return new RootParser(this); }
        }
        public IDecompiler Decompiler
        {
            get { throw new NotImplementedException(); }
        }
        public ScriptHost Host { get; set; }
        public Configuration Configuration { get; set; }

        #region Install/UnInstall
        public bool IsInstalled
        {
            get
            {
                return true;
            }
        }
        public void Install()
        {
        }
        public void UnInstall()
        {
        }
        #endregion

        #endregion

        #region IClassInfo Member
        public string Name
        {
            get { return Constants.ROOT_PROVIDER; }
        }
        public string Author
        {
            get { return "Krissel095, haefele"; }
        }
        public Version Version
        {
            get { return new Version("1.0.0.0"); }
        }
        public string Description
        {
            get { return "Base provider for scripts"; }
        }
        public System.Drawing.Bitmap Icon
        {
            get { return null; }
        }
        #endregion
    }
}
